package com.example.bbs.mapper;

import com.example.bbs.dto.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserInfoMapper {


    @Select( "select * from userinfo join user on userinfo.username = user.username where userinfo.username = #{username}")
    UserInfo selectUserInfoData(String username);

    @Insert("insert into userinfo(username)  values(#{username}) ")
    void insertUserInfoData(String username);

    @Update("update userinfo set name = #{name},age = #{age}, email = #{email} where username = #{username} ")
    void updateUserInfo(UserInfo userInfo);
}
